{template 'header'}
<script src="../addons/bsht_vcard/res/js/MagicZoom.js"></script>
<div class='container' style='padding: 0 5px 10px; margin: 0; width: 100%'>
	<ul class="nav nav-tabs">
		<li class="active"><a href="{php echo $this->createWebUrl('listshow');}">晒单列表</a></li>

		<!--li><a href="{php echo $this->createWebUrl('listshow_add',array('op'=>'add'));}">添加晒单</a></li-->
	</ul>

<!--div class="panel panel-info">
	<div class="panel-heading"></div>
</div-->

<div class="panel panel-info">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
        	<input type="hidden" name="m" value="bsht_tbk" />
        	<input type="hidden" name="do" value="listshow" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>
				<div class="col-sm-8 col-lg-3">
					<input class="form-control" name="keyword" id="" placeholder="输入昵称、openidID、单号" type="text" value="{$_GPC['keyword']}">
				</div>

				
					<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>
					<div class="col-sm-8 col-lg-2">
						<select name="status" class="form-control">
							<option value="1" {if intval($_GPC['status']) == 1}selected="selected"{/if}>启用</option>
							<option value="0" {if intval($_GPC['status']) == 0}selected="selected"{/if}>禁用</option>
						</select>
					</div>
				

                                <div class=" col-xs-12 col-sm-2 col-lg-2">
					<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
					&nbsp;&nbsp;
					<a onclick="return confirm('该操作比较耗时，确认吗？'); return false;" href="{php echo $this->createWebUrl('list_show_delall');}" title="删除" class="btn btn-sm btn-danger"><i class="fa fa-remove"></i> 一键清空晒单记录</a>
				</div>
			</div>
 			<div class="form-group">
			</div>
		</form>
		
	</div>
 
    </div>
    <div style="padding:15px;">
        <table class="table table-hover">
            <thead class="navbar-inner">
                <tr style="width:100%">
				    <th width="80" style="text-align:center">ID</th>	
				    <th width="100" style="text-align:center">排序</th>	
					<th width="20%" style="text-align:left">基础信息</th>
					
					<th width="10%" style="text-align:center">订单信息</th>
					<th width="10%" style="text-align:center">其他信息</th>

					
					<th width="auto" style="text-align:center">晒单图</th>
					
					<th width="100" style="text-align:center">用户头像</th>
					<th width="100" style="text-align:center">客服消息</th>

                    <th width="20%" style="text-align:right">操作</th>
                </tr>
            </thead>
            <tbody>
                {loop $list $row}


                <tr>

                    <td style="text-align:center">{$row['id']}</td>
					<td style="text-align:center">{$row['displayorder']}</td>
					<td style="text-align:left"><span class="label label-success label-xs"><a title="点击查询" style="color:#fff" href="{if $oredrok==1}{php echo $this->createWebUrl('listorder',array('keyword'=>$row['orderid']))}{else}javascript:{/if}">单号：{$row['orderid']}</a></span>&nbsp;<span class="label label-info label-xs">入手价：{$row['orderfee']}</span><div style="height:5px"></div>内容：{$row['dec']}<br>昵称：{$row['nickname']}<div style="height:5px"></div><span class="label label-info label-xs">{$row['openid']}</span></td>
					
{if $row['queren']!=1}
<td style="text-align:center">
{if $row['oredrok']==1}
<span class="label label-info">单号有匹配</span>
<div style="height:15px"></div>
<span class="label label-info">付款金额￥{$row['orderfee2']}</span>
<div style="height:15px"></div>
<span class="label label-warning">效果预估￥{$row['shouru_yongjin2']}</span>
<div style="height:15px"></div>
<span class="label label-{if $row['orderstatus2']=='订单结算'}success{/if}{if $row['orderstatus2']=='订单付款'}warning{/if}{if $row['orderstatus2']=='订单失效'}danger{/if}">{$row['orderstatus2']}</span>
{else}
<span class="label label-danger">单号无匹配</span>
{/if}
</td>
{else}
<td style="text-align:center"><span class="label label-warning">该晒单已被确认</span></td>
{/if}




<td style="text-align:center">{if $row['status']==1}<span class="label label-success status" id="{$row['id']}">审核通过</span>{/if}{if $row['status']==0}<span class="label label-danger status" id="{$row['id']}">未审核</span>{/if}

<div style="height:15px"></div>
{if $row['queren']==1}
<span class="label label-success"><i class="fa fa-credit-card"></i> 已确认</span>
{else}
<span class="label label-danger"><i class="fa fa-credit-card"></i> 未确认</span>
{/if}
<div style="height:15px"></div>
<span class="label label-success"><i class="fa fa-credit-card"></i> {if $row['vnum']}{$row['vnum']}{else}0{/if} 晒单</span>

</td>


					<td style="text-align:center">
					
					
{if !empty($row['img1'])}
<a  href="{php echo tomedia($row['img1'])}" class="MagicThumb">
<img src="{php echo tomedia($row['img1'])}" style="height:40px;width:40px">
</a>&nbsp;&nbsp;

{if !empty($row['img2'])}
<a  href="{php echo tomedia($row['img2'])}" class="MagicThumb">
<img src="{php echo tomedia($row['img2'])}" style="height:40px;width:40px">
</a>&nbsp;&nbsp;
{/if}

{if !empty($row['img3'])}
<a  href="{php echo tomedia($row['img3'])}" class="MagicThumb">
<img src="{php echo tomedia($row['img3'])}" style="height:40px;width:40px">
</a>&nbsp;&nbsp;
{/if}

{if !empty($row['img4'])}
<a  href="{php echo tomedia($row['img4'])}" class="MagicThumb">
<img src="{php echo tomedia($row['img4'])}" style="height:40px;width:40px">
</a>&nbsp;&nbsp;
{/if}

{if !empty($row['img5'])}
<a  href="{php echo tomedia($row['img5'])}" class="MagicThumb">
<img src="{php echo tomedia($row['img5'])}" style="height:40px;width:40px">
</a>&nbsp;&nbsp;
{/if}


{else}
					暂无图片
{/if}
					
					
					</td>

					<td style="text-align:center">
					{if !empty($row['avatar'])}
					<a  href="{php echo tomedia($row['avatar'])}" class="MagicThumb">
					<img src="{php echo tomedia($row['avatar'])}" style="height:40px;width:40px"></a>&nbsp;&nbsp;
					{else}
					暂无图片
					{/if}
					</td>


					<td style="text-align:center">{if $row['follow']==1}<a class="label label-success" title="发送客服消息" href="index.php?c=mc&a=notice&do=tpl&id={$row['fanid']}" target="_blank"><i class="fa fa-comment-o"></i> 点击发送</a>{else}<a class="label label-warning" title="用户暂未关注，不能发送客服消息！" href="javascript:"><i class="fa fa-exclamation-circle"></i> 无法使用</a>{/if}</td>

<td style="text-align:right">

					

					<!--a class="btn   btn-default" title="编辑" href="{php echo $this->createWebUrl('listshow_add',array('op'=>'edit','id'=>$row['id']))}" ><i class="fa fa-edit"></i> 编辑</a-->
					
					{if $row['queren']==0 && $row['follow']==1}
                    <!--a class="btn  btn-info" rel="tooltip" href="javascript:void();" onclick="drop_confirm('您确定要赠送积分吗?', '{php echo $this->createWebUrl('listshow_jifen',array('id'=>$row['id']))}');" title="赠送积分">确认赠送积分({$row['jifen']}) <i class="fa fa-eye"></i></a-->

					<a class="btn btn-sm btn-info" href="javascript:importrow1({$row['jifen']},{php echo $row['shouru_yongjin2']*$setting['sdbili']},{$row['id']})"><i class="fa fa-times"></i> 确认赠送积分({php echo $row['jifen']+$row['shouru_yongjin2']*$setting['sdbili']})</a>
					{/if}

                    {if $row['follow']==1}
					
					
					<a class="btn btn-sm btn-danger" rel="tooltip" href="javascript:void();" onclick="drop_confirm('您确定要删除吗?删除不可恢复，同时删除所有相关数据！', '{php echo $this->createWebUrl('listshow_del',array('id'=>$row['id'],'queren'=>$row['queren']))}');" title="删除并扣除积分">删除{if $row['queren']==1}并扣除积分({$row['jifen']}){/if} <i class="fa fa-times"></i></a>
					
					
					
					{else}
					<a class="btn btn-sm btn-info" rel="tooltip" href="javascript:void();" title="已取消关注，不用操作">已取消关注，不用操作</a>
					{/if}
</td>
                </tr>
                {/loop}
            </tbody>
        </table>
        {$pager}
    </div>

</div>

<style>
	.masklayer{ display: none; width: 100%; height: 100%; position: fixed; z-index: 1000; top: 0px; left: 0px; background: rgba(0,0,0,0.7);}
	.mask{ display: none; width: 460px; height: auto; overflow: hidden; position: fixed; z-index: 2000; left: 50%; margin-left: -230px; background: #fff; top: 20%;}
	.mask .title{ width: 100%; height: 40px; line-height: 40px; background:#467ab3; position: relative; z-index: 10;}
	.mask .title span{ margin-left: 15px; color: #fff; font-size: 14px;}
	.mask .title .close{ width: 40px; height: 40px; position: absolute; display: block; top: 7px; right: -15px;color:#fff; z-index: 20;}
	.maskMain{  padding: 0px; height: auto; overflow: hidden; text-align: center; padding-bottom: 30px;}
	.maskMain a{ width: 40%; height: 46px; line-height: 46px; text-align: center; display: inline-block; background: #467ab3; color: #fff; border: 1px solid #000; margin: 30px 15px 0px 15px;}
</style>
<div class="masklayer" onclick="javascript:close1();" style="display: none;" id="masklayer1"></div>
<div class="mask maskOuter" style="display: none;" id="mask1">
			<p class="title">
				<span>请选择积分奖励方式</span>
				<em class="close" onclick="javascript:close1();">X</em>
			</p>
			<div class="maskMain">
				<input type="text" id="diyjifen" name="diyjifen" value="0"/>  额外奖励积分
				<input type="hidden" id="jifen" name="jifen" value="" />
				<input type="hidden" id="jfid" name="jfid" value="" />
				<button class="btn btn-info" style="margin-left:5%;margin-top:20px;" onclick="queren();">确认基础奖励积分，并额外奖励积分</button>
			</div>
</div>


<script>
function queren(){
	var jfid = $('#jfid').val();
	var diyjifen = $('#diyjifen').val();
	var jifen = $('#jifen').val();
	drop_confirm('确定奖励'+jifen+'积分,以及额外奖励'+diyjifen+'积分？', './index.php?c=site&a=entry&id='+jfid+'&do=listshow_jifen&m=bsht_tbk&diyjifen='+diyjifen);
}


function importrow1(jifen,jifen2,jfid){
	$('#jfid').val(jfid);
	$('#jifen').val(jifen);
	$('#diyjifen').val(jifen2);
	$("#mask1").fadeIn(500);
	$("#masklayer1").fadeIn(500);
}
function close1(){
	$(".maskOuter").fadeOut(500);
	$(".masklayer").fadeOut(500);
}

            function drop_confirm(msg, url){
            if (confirm(msg)){
            window.location = url;
            }
            }
$(document).ready(function(){ 
　　$(".status").click(function(){ 

var cid=$(this).attr('id');
var url = "{php echo $this->createWebUrl('listshow_ajax');}&id="+cid;		
$.post(url, function(dat){
dat = eval('('+dat+')');

if (dat.status==1)
{
var cid=dat.id;
$("#"+cid).removeClass("label-danger");
$("#"+cid).addClass("label-success");
$("#"+cid).hide();
$("#"+cid).html('审核通过').fadeIn(500);
}

if (dat.status==0)
{
var cid=dat.id;
$("#"+cid).removeClass("label-success");
$("#"+cid).addClass("label-danger");
$("#"+cid).hide();
$("#"+cid).html('未审核').fadeIn(500);
}

});
　　　//alert(cid);
　　}); 
}); 
</script>
　
{template 'footer'}